package Sever;

import java.awt.BorderLayout;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

import client.Client;

import java.awt.event.ActionEvent;

public class tbaleGame {
	public JButton btus1, btus2;
	public User us1, us2;
	public int kt1, kt2;
	public int id;
	Client cl = null;
	public tbaleGame(int id) {
		this.id = id;
		kt1 = kt2 = 0;
		btus1 = new JButton(new ImageIcon(".//picture//thamgia.png"));
		btus2 = new JButton(new ImageIcon(".//picture//thamgia.png"));
	}

	public JPanel tabgame() {
		JPanel lg = new JPanel(new BorderLayout());
		JPanel jpE = new JPanel();
		jpE.setSize(20, 400);
		lg.add(jpE, BorderLayout.NORTH);
		btus1.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
				if (kt1 == 0) {
					btus1.setIcon(new ImageIcon(".//picture//usgame.png"));
					kt1 = 1;
				}
			}
		});
		btus2.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
				if (kt2 == 0) {
					btus2.setIcon(new ImageIcon(".//picture//usgame.png"));
					kt2 = 1;
				}
			}	
			
		});
		lg.add(btus1, BorderLayout.EAST);
		lg.add(btus2, BorderLayout.WEST);
		lg.add(new JLabel(new ImageIcon(".//picture//tbkgame.png")),
				BorderLayout.CENTER);
		lg.add(new JLabel("--" + id + "--", JLabel.CENTER), BorderLayout.SOUTH);
		return lg;
	}

}
